<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link type="text/css" rel="stylesheet" href="css/shop.css">
<script type="text/javascript" src="js/jquery-1.11.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$("#addButton").click(function(){
		window.location.href="createfood.do";
	});
	$(".updateButton").click(function(){
		var id = $(this).parent().parent().find(":first-child").html();
		window.location.href="findFood.do?id="+id;
	});
	$(".deleteButton").click(function(){
		var id = $(this).parent().parent().find(":first-child").html();
		window.location.href="deleteFood.do?id="+id;
	});
	$("#shopButton").click(function(){
		window.location.href="shoplist.do"
	});
	$("#foodButton").click(function(){
		window.location.href="foodlist.do"
	});
	$("#userButton").click(function(){
		window.location.href="userlist.do"
	});
	$("#orderButton").click(function(){
		window.location.href="orderlist.do"
	});
	$("#collectButton").click(function(){
		window.location.href="collectlist.do"
	});
	$("#addPic").click(function(){
		window.location.href="listPics.do"
	});
});

</script>
</head>
<body>
<div id="menu"><Button class="menuButton" id="shopButton">店铺</Button><Button class="menuButton" id="foodButton">菜品</Button><button class="menuButton" id="orderButton">订单</button><button class="menuButton" id="userButton">用户</button><button class="menuButton" id="collectButton">收藏</button>
</div>
</div>
<div id="toolbar"><form action="searchFood.do"><button class="menuButton"  type="button" id="addButton">添加</button>
<script>

</script>
<select name="condition">
<option value="food_id">食物ID</option>
<option value="foodname">食物名称</option>
<option value="shopname">所属店铺</option>
<option value="typename">所属种类</option>
<option value="price">单价</option>
<option value="intro">食物简介</option>
<option value="recommand">是否推荐</option>
</select><input type="text" name="value" id="inputtext"/><input type="submit" value="搜索"/><button class="menuButton"  type="button" style="margin-left:20px" id="addPic">添加图片</button></form>
</div>
<div id="table" > 
<table border=1 cellspacing="0" cellpadding="0">
<tr>
<th >食物ID</th><th >食物名称</th><th >所属店铺</th><th >种类名称</th><th>单价</th><th>食物图片</th><th>食物简介</th><th>是否推荐</th><th>操作</th>
</tr>
 <c:forEach items="${list }" var="s">
 <tr>
 <td>${s.food_id}</td><td>${s.foodname}</td><td>${s.shopname}</td>
 <td>${s.typename}</td><td>${s.price}</td><td><img alt="" src="image/${s.pic}.jpg" width="100px" height="100px"></td><td>${s.intro}</td><td>${s.recommand}</td><td><button class="updateButton" >修改</button ><button class="deleteButton">删除</button></td>
 </tr>
 </c:forEach>
</table>
</div>
</body>
</html>